package jp.syuriken.snsw.terenaibot.internal;

import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;

import jp.syuriken.snsw.terenaibot.Post;
import jp.syuriken.snsw.terenaibot.PostWrapper;

/**
 * 標準出力への{@link PostWrapper}。デバッグ用。
 * 
 * @author $Author: snswinhaiku.lo@gmail.com $
 */
public class StdoutPostWrapper extends PostWrapper {
	
	@Override
	public Post getPost(String postId) {
		return null;
	}
	
	@Override
	public Object getPostActionClass() {
		return System.err;
	}
	
	@Override
	public String getUserName() {
		return "no name";
	}
	
	@Override
	public String getWrapperName() {
		return "StdoutPostWrapper";
	}
	
	@Override
	public Post post(String poststr) {
		super.post(poststr);
		Date date = new Date();
		DateFormat dateFormat = new SimpleDateFormat("HH:mm:ss");
		System.out.printf("[%s] %s%n", dateFormat.format(date), poststr);
		return null;
	}
	
}
